home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Alles Voor Internet / Tout Pour Internet
/
alles voor internet.iso
/
MacInternet™
/
Telnet
/
NCSA
/
tn3270 2.3d26 source
/
tn3270
/
termdef.h
< prev
next >
Wrap
Text File
|
1991-05-26
|
14KB
|
406 lines
/*
* tn3270 for the Macintosh Source Code
* Brown University Computing and Information Services
* Version 2.3d21, January 17, 1991
* Copyright (c) 1988, 1989, 1990, 1991 by Brown University and by
* Peter John DiCamillo.
*
* Permission is granted to any individual or institution to use, copy,
* or redistribute the binary version of this software and its
* documentation provided this notice and the copyright notices are
* retained. Permission is granted to any individual or non-profit
* institution to use, copy, modify, or redistribute the source files
* of this software provided this notice and the copyright notices are
* retained. This software may not be distributed for profit, either
* in original form or in derivative works, nor can the source be
* distributed to other than an individual or a non-profit institution.
* Any individual or group interested in seeing and/or using these
* source files but who are prevented from doing so by the above
* constraints should contact Don Wolfe, Assistant Vice-President for
* Computer Systems at Brown University, (401) 863-7250, for possible
* software licensing of the source developed at Brown.
*
* Brown University and Peter John DiCamillo make no representations
* about the suitability of this software for any purpose.
*
* BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
* EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
* INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#define NUL 0x00
#define CD 0x01
#define GRFBGN 0x04
#define XFBGN 0x06
#define BEL 0x07
#define BS 0x08
#define TAB 0x09
#define LF 0x0a
#define VT 0x0b
#define FF 0x0c
#define CR 0x0d
#define SO 0x0e
#define DC1 0x11
#define DC3 0x13
#define DC4 0x14
#define CPMEOF 0x1a
#define ESC 0x1b
#define DEL 0x7f
#define NMENUS 6
#define portalrt 256 /* stoperr message codes */
#define loadalrt 257
#define srvalrt 258
#define atpalrt 259
#define rmtalrt 260
#define nackalrt 261
#define ioalrt 262
#define rsetalrt 263
#define ssetalrt 264
#define wsetalrt 265
#define addralrt 266
#define regalrt 267
#define cfigalrt 268
#define domalrt 269
#define topnalrt 270
#define conalrt 271
#define rspalrt 272
#define numalrt 273
#define negalrt 274
#define wrtalrt 275
#define et1alrt 276
#define et2alrt 277
#define et3alrt 278
#define mapalrt 279
#define wpictalrt 280
#define kbdefalrt 281
#define kbsetalrt 282
#define nlsetalrt 283
#define fmtalrt 284
#define hostfalrt 285
#define sdsetalrt 286
#define sdmemalrt 287
#define newwindalrt 288
#define windfmtalrt 289
#define apinalrt 290
#define apisalrt 291
#define pnumalrt 292
#define ppcinitalrt 293
#define ppcnamealrt 294
#define ppcopenalrt 295
#define ACK 0 /* AppleTalk Server Codes */
#define NACK 1
#define POLL 2
#define DATA 3
#define WANT_BIG_DATA 4
#define GOT_BIG_DATA 5
#define LOGON 6
#define LOGOFF 7
#define NOREMOTE 8
#define NOLOCAL 9
#define NDATA 0x01 /* PCNet Server Codes */
#define NLOGOFF 0x02
#define NCNTDATA 0x03
#define NLOGON 0x04
#define NLOGA24 0x10
#define NLOGE24 0x11
#define NLOGW24 0x91
typedef struct { /* Format of PCNET packet data */
unsigned char type;
unsigned char data[2499];
} npacket;
/* equates for CP DIAG X'7C' ldev creation */
#define WSFFLAG 0x80 /* flag for Write Structured Field support */
#define MDL32782 0x02 /* 3278 model 2 (24 by 80) */
#define MDL32783 0x03 /* 3278 model 3 (32 by 80) */
#define MDL32784 0x04 /* 3278 model 4 (43 by 80) */
#define MDL32785 0x05 /* 3278 model 5 (27 by 132) */
#define MDL32792 0x92 /* 3279 model 2 (24 by 80) */
#define MDL32793 0x93 /* 3279 model 3 (32 by 80) */
#define CLASGRAF 0x40
#define TYP3278 0x01
/* definitions for built-in fonts */
#define SYMBOLFONT 239
#define NORMALFONT 240
#define APLFONT 241
#define BOLDNORMAL 242
#define BOLDAPL 243
#define ALAFONT 244
#define BOLDALA 246
typedef struct { /* element of keyboard input queue */
unsigned char code;
unsigned char shift;
} kbdata;
#define KBQMAX 160 /* size of queue */
/* typedef struct {
unsigned char * name;
unsigned char type;
unsigned char unused;
short size;
unsigned char * fvalptr;
unsigned char * cvalptr;
unsigned char * description;
} keyinfo; */
typedef struct {
unsigned char attrmap[7]; /* attribute mappings */
char dblevel; /* debug level */
char setsflg; /* connection mode */
unsigned char timeout; /* seconds between retransmits */
unsigned char retries; /* number of retries */
char insreset; /* attn resets insert mode */
char impnull; /* improved null processing */
char digitpfk; /* Cmd Shift <digit> is PF */
short mousepf; /* double-click function */
char basecolor; /* base color mode */
char exactcolor; /* exact colors wanted */
/* current color settings */
RGBColor usrwhite;
RGBColor usryellow;
RGBColor usrpink;
RGBColor usrturquoise;
RGBColor usrgreen;
RGBColor usrred;
RGBColor usrblue;
RGBColor usrblack;
RGBColor usrback;
RGBColor usrstat;
short dfltptsize; /* default screen point size */
short altptsize; /* alternate screen point size */
short altrows; /* rows for alternate screen */
short altcols; /* columns for alternate screen */
short custrows; /* custom row size */
short custcols; /* custom column count */
short windpth; /* window center point- horiz. pos. */
short windptv; /* window center point- vert. pos. */
char invertbw; /* swap black and white */
char stat_time; /* status line time display */
char curpos; /* display cursor position */
char blockcurs; /* block cursor */
char ext3270; /* extended data stream support */
char std_brack; /* treat [ and ] normally */
char windmax; /* always use maximum window size */
char repnull; /* change embedded blanks to nulls */
char savewpos; /* save window position in file */
char autoconn; /* connect to host when settings loaded */
OSType text_creator; /* creator for text files */
char simps; /* simulate programmed symbol support */
char unused; /* for even length */
/* even length should be maintained */
} settings_list;
#define DFLTWHITE {0xffff, 0xffff, 0xffff}
#define DFLTYELLOW {0xfc00, 0xf37d, 0x052f}
#define DFLTRED {0xdd6b, 0x08c2, 0x06a2}
#define CTDFLTPINK {0xf2d7, 0x0856, 0x84ec} /* in 16-color ctab */
#define DFLTPINK {0xffff, 0x7a5d, 0x9f8e}
#define CTDFLTBLUE {0x0000, 0x0000, 0xd400} /* in 16-color ctab */
#define DFLTBLUE {0x4eba, 0x6aea, 0xdd6b}
#define CTDFLTTURQUOISE {0x0241, 0xab54, 0xeaff} /* in 16-color ctab */
#define DFLTTURQUOISE {0x0000, 0xc42f, 0xeaff}
#define DFLTGREEN {0x1f21, 0xb793, 0x1431}
#define DFLTBLACK {0x0000, 0x0000, 0x0000}
#define DFLTBACK {0x2a00, 0x2a00, 0x2a00}
#define CTDFLTBACK {0x4000, 0x4000, 0x4000} /* in 16-color ctab */
/* palette indices for colors */
#define RGBblack 1
#define RGBwhite 2
#define RGBback 3
#define RGBgreen 4
#define RGBred 5
#define RGBblue 6
#define RGBpink 7
#define RGByellow 8
#define RGBturquoise 9
#define RGBstat 10
/* point positions for selected text
3---------------------4
| |
1------2 |
| |
| |
| 6-------------5
| |
8--------------7
*/
typedef struct { /* coordinates defining selected text */
short x1;
short y1;
short x2;
short y2;
short x3;
short y3;
short x4;
short y4;
short x5;
short y5;
short x6;
short y6;
short x7;
short y7;
short x8;
short y8;
} selcoord;
typedef struct scrapline { /* definition of private scrap line element */
struct scrapline *nextline;
unsigned char *text;
unsigned short *attr;
} scrapline;
typedef struct hexmap {
unsigned short offset;
unsigned char stdchar;
unsigned char aplchar;
} hexmap;
typedef struct vmprt { /* values to control WMAC PRINT output */
/* default: definition: */
unsigned short fontnum; /* 22 font number */
/* monaco = 4; courier = 22 */
unsigned short pointsize; /* 11 font point size */
unsigned short leading; /* 12 line spacing, inches*72 */
unsigned short linewidth; /* 132 maximum characters per line; */
/* *cannot exceed 132* */
unsigned short tabsize; /* 4 tab spacing */
unsigned short pagelength; /* 57 maximum lines/page (no cc) */
unsigned short pagelencc; /* 59 maximum lines/page (with cc) */
unsigned short top; /* 14 top margin, inches*72 */
unsigned short headmarg; /* 2 lines between header & text (no cc) */
unsigned short left; /* 12 left margin, inches*72 (no cc) */
unsigned short leftcc; /* 0 left margin, inches*72 (with cc) */
unsigned short titlewidth; /* 74 width of title line in characters */
/* *cannot exceed 132* */
unsigned short unused1; /* 0 space for future additions */
unsigned short unused2; /* 0 */
unsigned short unused3; /* 0 */
unsigned short unused4; /* 0 */
} vmprt; /* this structure is stored in the VMPR 128 resource */
#define MAXLINEWIDTH 132 /* maximum allowed for line width */
typedef struct uareply { /* Usable Area Query Reply */
unsigned short length; /* structured field total length (46) */
unsigned char sfid; /* structured field id (X'81') */
unsigned char qcode; /* usable area id (X'81') */
unsigned char flags1; /* first flag byte (X'03') */
unsigned char flags2; /* second flag byte (X'00') */
unsigned short w; /* width of usable area (computed) */
unsigned short h; /* height of usable area (computed) */
unsigned char units; /* units of measure (X'00' = inches) */
unsigned char xr[4]; /* x point spacing (X'00010048' = 1/72) */
unsigned char yr[4]; /* y point spacing (X'00010048' = 1/72) */
unsigned char aw; /* width of default cell (computed) */
unsigned char ah; /* height of default cell (computed) */
unsigned char buffsz[2]; /* character buffer size (X'0000') */
unsigned char xmin; /* minimum x units in cell (X'00') */
unsigned char ymin; /* minimum y units in cell (X'00') */
unsigned char xmax; /* maximum x units in cell (X'00') */
unsigned char ymax; /* maximum y units in cell (X'00') */
unsigned char aualen; /* length for alternate usable area (X'13') */
unsigned char auapid; /* parameter id for alt. usable area (X'02') */
unsigned char auares; /* reserved (X'00') */
unsigned char auaid; /* id for alt. usable area partition (X'01') */
unsigned char waua[2]; /* width of alt. usable area (computed) */
unsigned char haua[2]; /* height of alt. usable area (computed) */
unsigned char auaunits; /* units of measure (X'00' = inches) */
unsigned char auaxr[4]; /* x point spacing (X'00010048' = 1/72) */
unsigned char auayr[4]; /* y point spacing (X'00010048' = 1/72) */
unsigned char awaua; /* width of default cell (computed) */
unsigned char ahaua; /* height of default cell (computed) */
} uareply;
typedef struct ipreply { /* Implicit Partition Query Reply */
unsigned short length; /* structured field total length (28) */
unsigned char sfid; /* structured field id (X'81') */
unsigned char qcode; /* implicit partition id (X'A6') */
unsigned char flags[2]; /* flags - reserved (X'0000') */
unsigned char scrnlen; /* length of screen parameters (X'0B') */
unsigned char scrnpid; /* screen parameter id (X'01') */
unsigned char scrnflags; /* screen flags - reserved (X'00') */
unsigned char wd[2]; /* default width in chars (computed) */
unsigned char hd[2]; /* default height in chars (computed) */
unsigned char wa[2]; /* alternate width in chars (computed) */
unsigned char ha[2]; /* alternate height in chars (computed) */
unsigned char celllen; /* length of cell sizes (X'0B') */
unsigned char cellpid; /* cell size parameter id (X'02') */
unsigned char cellflags; /* cell size flags - reserved (X'00') */
unsigned char wcd[2]; /* default cell width (computed) */
unsigned char hcd[2]; /* default cell height (computed) */
unsigned char wca[2]; /* alternate cell width (computed) */
unsigned char hca[2]; /* alternate cell height (computed) */
} ipreply;
#define NMRNUM 2 /* number of notification manager messages */
typedef struct { /* Notification Manager record and message */
NMRec qelem;
unsigned char msg[256];
} nmrmessage;
typedef struct {
unsigned char *next; /* actually qctl* */
char inuse;
char pend_inuse;
} qctl;
typedef struct { /* PPC queue descriptor */
unsigned char name[8]; /* name of queue (for messages) */
qctl *first; /* pointer to first element */
Size elemsize; /* size of one queue element */
short minavail; /* allocate to keep this many available */
char stgerr; /* allocation failed */
char spare;
} queueinfo;
typedef struct {
long sessrefnum;
long userdata;
char servicetype;
char reqtype;
char mykind; /* 0 for session manager, or session number */
char spare;
} clientinfo;
typedef struct {
long length;
long userdata;
long creator;
long type;
long sessrefnum;
char more;
char incoming; /* true if data from PPCRead */
char mykind; /* 0 for session manager, or session number */
char spare;
unsigned char msg[128];
} datainfo;
typedef struct {
qctl header;
PPCParamBlockRec pb;
} paramrec;
typedef struct {
qctl header;
clientinfo client;
} clientrec;
typedef struct {
qctl header;
datainfo data;
} datarec;